#include<func.h>
//线程函数,pthread_func执行结束，线程就结束了
void* pthread_func(void *p)
{
    printf("I am child thread\n");
}
//pthread开头的函数都不可以用perror来定位错误
int main()
{
    pthread_t pthid;//定义线程pid
    int ret=pthread_create(&pthid,NULL,pthread_func,NULL);
    if(ret!=0)
    {
        printf("pthread creat failed\n");
        return -1;
    }
    sleep(1);
    printf("I am main thread\n");
    return 0;
}